clear all
cls 
set more off
set scheme sj

// Set working directory
cd "/Users/zeno/Google Drive/RA/KQ/China Audience Cost Experiment/Dataverse"

capture log close
log using "Dataverse Output.txt", text replace

import delimited "Quek_and_Johnston_dataset.csv", case(preserve) clear

/************ 
 ************
 Main text
 ************
 ************/


/************ 
 t-tests:
 Main treatment effects 
************/

* Treatment 1: UN mediation offer
ttest approval, by(UN_mediation)

* Treatment 2: U.S. deterrent warning
ttest approval, by(US_threat)

* Treatment 3: Peaceful identity rhetoric
ttest approval, by(peaceful_id)

* Treatment 4: Economic costs rhetoric
ttest approval, by(econ_cost)

* Treatment 5: Economic sanctions
ttest approval, by(sanction)

* Treatment 6: Ambiguous threat
ttest approval, by(ambiguous_threat)

/************ 
 proportion tests:
 Main treatment effects 
 ************/

* Treatment 1: UN mediation offer
prtest approve, by(UN_mediation)

* Treatment 2: U.S. deterrent warning
prtest approve, by(US_threat)

* Treatment 3: Peaceful identity rhetoric
prtest approve, by(peaceful_id)

* Treatment 4: Economic costs rhetoric
prtest approve, by(econ_cost)

* Treatment 5: Economic sanction
prtest approve, by(sanction)

* Treatment 6: Ambiguous threat
prtest approve, by(ambiguous_threat)

/************ 
 t-tests: 
 Nativist vs. non-nativist
 Heterogeneous treatment effects 
************/

* Treatment 1: UN mediation offer
ttest approval if nativist == 1, by(UN_mediation)
ttest approval if nativist == 0, by(UN_mediation)

* Treatment 2: U.S. deterrent warning
ttest approval if nativist == 1, by(US_threat)
ttest approval if nativist == 0, by(US_threat)

* Treatment 3: Peaceful identity rhetoric
ttest approval if nativist == 1, by(peaceful_id)
ttest approval if nativist == 0, by(peaceful_id)

* Treatment 4: Economic costs rhetoric
ttest approval if nativist == 1, by(econ_cost)
ttest approval if nativist == 0, by(econ_cost)

* Treatment 5: Economic sanctions
ttest approval if nativist == 1, by(sanction)
ttest approval if nativist == 0, by(sanction)

* Treatment 6: Ambiguous threat
ttest approval if nativist == 1, by(ambiguous_threat)
ttest approval if nativist == 0, by(ambiguous_threat)

/************ 
 t-tests: 
 Dove vs. hawk
 Heterogeneous treatment effects 
************/

* Treatment 1: UN mediation offer
ttest approval if dove == 1, by(UN_mediation)
ttest approval if dove == 0, by(UN_mediation)

* Treatment 2: U.S. deterrent warning
ttest approval if dove == 1, by(US_threat)
ttest approval if dove == 0, by(US_threat)

* Treatment 3: Peaceful identity rhetoric
ttest approval if dove == 1, by(peaceful_id)
ttest approval if dove == 0, by(peaceful_id)

* Treatment 4: Economic costs rhetoric
ttest approval if dove == 1, by(econ_cost)
ttest approval if dove == 0, by(econ_cost)

* Treatment 5: Economic sanctions
ttest approval if dove == 1, by(sanction)
ttest approval if dove == 0, by(sanction)

* Treatment 6: Ambiguous threat
ttest approval if dove == 1, by(ambiguous_threat)
ttest approval if dove == 0, by(ambiguous_threat)


/************ 
 ************
 Appendix
 ************
 ************/
 
* Table A1
ologit approval UN_mediation
ologit approval UN_mediation age edu  
ologit approval UN_mediation gender race age edu income  
ologit approval UN_mediation gender race age edu income partymember unmarried  
ologit approval UN_mediation gender race age edu income partymember unmarried knowledge interest globalize  

* Table A2
ologit approval US_threat
ologit approval US_threat age edu  
ologit approval US_threat gender race age edu income  
ologit approval US_threat gender race age edu income partymember unmarried  
ologit approval US_threat gender race age edu income partymember unmarried knowledge interest globalize  

* Table A3
ologit approval peaceful_id
ologit approval peaceful_id age edu  
ologit approval peaceful_id gender race age edu income  
ologit approval peaceful_id gender race age edu income partymember unmarried  
ologit approval peaceful_id gender race age edu income partymember unmarried knowledge interest globalize  

* Table A4
ologit approval econ_cost
ologit approval econ_cost age edu  
ologit approval econ_cost gender race age edu income  
ologit approval econ_cost gender race age edu income partymember unmarried  
ologit approval econ_cost gender race age edu income partymember unmarried knowledge interest globalize  

* Table A5
ologit approval sanction
ologit approval sanction age edu  
ologit approval sanction gender race age edu income  
ologit approval sanction gender race age edu income partymember unmarried  
ologit approval sanction gender race age edu income partymember unmarried knowledge interest globalize  

* Table A6
ologit approval ambiguous_threat
ologit approval ambiguous_threat age edu  
ologit approval ambiguous_threat gender race age edu income  
ologit approval ambiguous_threat gender race age edu income partymember unmarried  
ologit approval ambiguous_threat gender race age edu income partymember unmarried knowledge interest globalize  

log close
